package o;

import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable.ConstantState;
import androidx.annotation.NonNull;

public abstract class xg<T extends Drawable> implements tx<T>, tp {
    protected final T ˋ;

    @NonNull
    public /* synthetic */ Object ˋ() {
        return ˏ();
    }

    public xg(T t) {
        this.ˋ = (Drawable) aas.ˎ(t);
    }

    @NonNull
    public final T ˏ() {
        ConstantState constantState = this.ˋ.getConstantState();
        if (constantState == null) {
            return this.ˋ;
        }
        return constantState.newDrawable();
    }

    public void ˊ() {
        if (this.ˋ instanceof BitmapDrawable) {
            ((BitmapDrawable) this.ˋ).getBitmap().prepareToDraw();
        } else if (this.ˋ instanceof xt) {
            ((xt) this.ˋ).ˎ().prepareToDraw();
        }
    }
}
